/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.sys.service;

import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.sys.dao.ShopAddDao;
import com.thinkgem.jeesite.modules.sys.dao.TbUserVerifyDao;
import com.thinkgem.jeesite.modules.sys.dao.WechatUserDao;
import com.thinkgem.jeesite.modules.sys.entity.TbMpWalletStream;
import com.thinkgem.jeesite.modules.sys.entity.TbTenementWalletStream;
import com.thinkgem.jeesite.modules.sys.entity.TbUser;
import com.thinkgem.jeesite.modules.sys.entity.TbUserVerify;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 身份证审核Service
 * @author huoyan403
 * @version 2016-10-29
 */
@Service
public class WechatUserService  {
	@Autowired
	private WechatUserDao wechatUserDao;
	//微信用户列表
	public Page<TbUser> findPage(Page<TbUser> page, TbUser tbUser) {
		tbUser.setPage(page);
		List list=wechatUserDao.findList(tbUser);
		for(int i=0;i<list.size();i++){
			TbUser t=(TbUser)list.get(i);
			//根据微信用户id从麻雀钱包中查出余额\
			BigDecimal b=wechatUserDao.selectMoneyByUid(t.getUid()+"");
			t.setMqtotalMoney(b);

		}
		page.setList(list);
		return page;
	}

	//物业钱包流水
	public Page<TbTenementWalletStream> tenemenetStream(Page<TbTenementWalletStream> page, TbTenementWalletStream tbTenementWalletStream) {
		tbTenementWalletStream.setPage(page);
		page.setList(wechatUserDao.tenemenetStream(tbTenementWalletStream));
		return page;
	}
	//麻雀钱包流水
	public Page<TbMpWalletStream> mpWalletStream(Page<TbMpWalletStream> page, TbMpWalletStream tbMpWalletStream) {
		//根据用户id‘得到麻雀流水记录
		tbMpWalletStream.setPage(page);
		List list=wechatUserDao.mpwalletStream(tbMpWalletStream);
		page.setList(list);
		return page;
	}
	public void isDelete(TbUser tbUser){
		Integer rows=wechatUserDao.isDelete(tbUser);
	}
}